#coding=utf-8

from collections import namedtuple

websites = [
    ('Sohu','www.sohu.com', u'张朝阳'),
    ('Sina','www.sina.com', u'王志东'),
    ('163','www.163.com', u'丁磊')
]

Website = namedtuple('Website',['name','url','founder'])
for website in websites:
    website = Website._make(website)
    print website



from collections import defaultdict
numbers= [
    ['male','Johb'],
    ['male','Jack'],
    ['female','lili'],
    ['female','luck']
]

result = defaultdict(list)
for sex, name in numbers:
    result[sex].append(name)
print result

# from collections import Counter
# cnt = Counter()
# for word in ['red','blue','red','red','orange']:
#     cnt[word] +=1
# print cnt

from collections import deque

a = deque([5,6,7,6,3,7,2])
print a.pop()
print a.popleft()
print a
print reversed(a)
print a.rotate(-1)
print a